let logger = require("pomelo-logger").getLogger(__filename);
let path = require("path");

module.exports = function (app) {
    return function () {
        initialize(app);
    };
};

function initialize(app) {
    app.set('proxyConfig', {
        retryTimes: -1
    });

    logger.info("initialize niuniu server");
    app.loadConfig("rooms", path.join(app.getBase(), "/config/niuniu/rooms.json"));
    let niuniuTableService = require(path.join(app.getBase(), "/app/domain/games/niuniu/niuniuTableService")).create(app);
    app.set('niuniuTableService', niuniuTableService);
}
